{{ define "logs_output" }}
  {{ range $k, $v := . }}
    {{ $title := $k | title }}
    {{ $id := printf "%s-log-output" $k }}
    <div class="py-3 px-5">
      <span class="flex justify-between items-center">
        <span class="text-lg">
          {{ partial "heading.html" (dict "text" $title "level" 4 "id" $id) }}
        </span>
      </span>

      {{ with $v.description }}
        <div class="mt-3 prose dark:prose-dark">
          {{ . | markdownify }}
        </div>
      {{ end }}

      {{ with $v.fields }}
        {{ $id := printf "%s-fields" $k }}
        <div class="mt-4 font-semibold">
          {{ partial "heading.html" (dict "text" "Fields" "level" 5 "id" $id) }}
        </div>

        <div class="mt-2 flex flex-col divide-y dark:divide-gray-700 border rounded dark:border-gray-700">
          {{ range $k, $v := . }}
            <div class="py-2.5 px-3.5">
              <span class="flex justify-between items-center">
                <span class="font-mono font-semibold">
                  {{ $k }}
                </span>

                <span class="flex space-x-1">
                  {{ if $v.required }}
                    {{ partial "badge.html" (dict "word" "required" "color" "red") }}
                  {{ else }}
                    {{ partial "badge.html" (dict "word" "optional" "color" "blue") }}
                  {{ end }}

                  {{ range $k, $v := $v.type }}
                    {{ $isArray := eq $k "array" }}
                    {{ if $isArray }}
                      {{ range $k, $v := $v.items.type }}
                        {{ $name := printf "[%s]" $k }}
                        {{ partial "badge.html" (dict "word" $name "color" "gray") }}
                      {{ end }}
                    {{ else }}
                      {{ partial "badge.html" (dict "word" $k "color" "gray") }}

                      {{ with $v.syntax }}
                        {{ partial "badge.html" (dict "word" . "color" "gray") }}
                      {{ end }}
                    {{ end }}
                  {{ end }}
                </span>
              </span>

              {{ with $v.description }}
                <div class="mt-2 prose dark:prose-dark">
                  {{ . | markdownify }}
                </div>
              {{ end }}

              {{ range $k, $v := $v.type }}
                {{ with $v.examples }}
                  <div class="mt-2">
                    <span> Examples </span>

                    <div class="mt-1.5 flex flex-col space-y-1 text-sm">
                      {{ range . }}
                        {{ template "code" . }}
                      {{ end }}
                    </div>
                  </div>
                {{ end }}
              {{ end }}
            </div>
          {{ end }}
        </div>
      {{ end }}
    </div>
  {{ end }}
{{ end }}
